const LOG_MAP = [
  ['/user/list', '获取角色列表'],
  ['/user/info', '获取用户信息'],
  ['/role/list', '获取角色列表'],
  ['/log/list', '获取日志列表'],
  ['/log/all', '清空所有日志'],
  ['/book/list', '获取书籍列表'],
  ['/dashboard/base-info', '获取总览信息'],
  ['/category/list', '获取书籍分类列表'],
  ['/category/add', '添加书籍的类型'],
  ['/forget-password/list', '获取重置密码的申请列表'],
  ['/auth/login', '用户登录'],
  ['/auth/register', '用户注册'],
  ['/book/update', '更新图书信息'],
  ['/book/add', '添加图书'],
]

export const getLogByPath = path => {
  let title = ''

  LOG_MAP.forEach(item => {
    if (path.includes(item[0])) {
      title = path.replace(item[0], item[1])
    }
  })
  return title || path
}
